#!/bin/bash

# 停止并禁用服务
echo "Stopping and disabling clientgui.service..."
sudo systemctl stop clientgui.service
sudo systemctl disable clientgui.service

# 删除服务文件
echo "Removing service file..."
sudo rm -f /etc/systemd/system/clientgui.service
sudo systemctl daemon-reload
sudo systemctl reset-failed

# # 删除项目目录
# echo "Removing project directory..."
# rm -rf /home/umeko/puregui

# 检查是否成功卸载
if [ ! -d "/home/umeko/puregui" ] && [ ! -f "/etc/systemd/system/clientgui.service" ]; then
    echo "Uninstallation successful."
else
    echo "Uninstallation failed. Please check manually."
fi
